#include <QApplication>
#include <QQmlApplicationEngine>
#include "LabelModel.h"
#include "ImageModel.h"

int main(int argc, char *argv[])
{

    QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
    QApplication app(argc, argv);
    QQmlApplicationEngine engine;
    qmlRegisterSingletonInstance("cn.conchit", 1, 0, "ImageModel", ImageModel::getInstance());
    qmlRegisterType<LabelModel>("cn.conchit", 1, 0, "LabelModel");

    ImageLabelModel imageLabelModel;
    qmlRegisterSingletonInstance("cn.conchit", 1, 0, "ImageLabelModel", &imageLabelModel);
    //qmlRegisterType<ImageLabelModel>("cn.conchit", 1, 0, "ImageLabelModel");


    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));

    return app.exec();
}
